package com.example.rabbit.listener;


import com.example.rabbit.entity.User;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.*;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

import java.io.IOException;


/**
 * 消息 接收者
 */
@Component
public class ParamReceiver {


    @RabbitListener(queues = "param_queue")
    @RabbitHandler
    public void getParam_queue_User(User user , Channel channel, Message message) throws IOException {
        System.out.println("消费者从param_queue队列取出消息"+user.toString());
        System.out.println(message);
    }
}
